// store/user/actions.ts

import { MenuState } from './types'
import { ActionTree } from 'vuex'
import { RootState } from '../types'

export const actions: ActionTree<MenuState, RootState> = {
  fetchData({ commit }): void {
    //  axios({
    //         url: 'https://....'
    //     }).then((response) => {
    //         const payload: User = response && response.data;
    //         commit('profileLoaded', payload);
    //     }, (error) => {
    //         console.log(error);
    //         commit('profileError');
    //     });
    const link: MenuState = {
      articles: [
        {
          category: '首页'
        }
      ],
      items: [
        {
          text: '首页',
          href: '/'
        }
      ]
    }
    commit('saveMenu', link)
  }
}
